<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>项目绑定</title>
	<script type="text/javascript">
        $(window).on('load', function () {
            $('.selectpicker').selectpicker({
                'selectedText': 'cat'
            });  
        });
        function unbind(){
        	var array;
        	$('input[name="checkbox"]:checked').each(function(){ 
        		console.info($(this).val());
        		array=$(this).val()+",";
        	});
        	$("#str").val(array);
        	$("#modifyForm").attr("action","unbind.do");
        	$("#modifyForm").submit();
        }
        function bind(){
        	$("#modifyForm").attr("action","goToBindProject.do");
        	$("#modifyForm").submit();
        }
    </script>
</head>
<body>
	<div class="container">
		<form id="modifyForm" class="form-signin" role="form" action="" method="post">
			<input type="hidden" name="str" value="" id="str" />
			<ul class="list-group">
				<c:forEach items="${bindProjects}" var="bindPro">
					<li class="list-group-item">
						
						<div class="row">
							<div class="col-md-1">
								<input type="checkbox" name="checkbox" value="${bindPro.projectID}-${bindPro.roleID}-${bindPro.userID}">
							</div>
							<div class="col-md-11">
							
								<h4 class="list-group-item-heading"><strong>${bindPro.communityName}</strong>${bindPro.communityNum}</h4>
		    					<p class="list-group-item-text">
		    						<strong><abbr title="合同号">合同号:</abbr>${bindPro.contractNum}</strong><BR />
		    						<div class="row">
										<div class="col-md-2"><abbr title="角色">角色:</abbr>${bindPro.roleName}</div>
										<div class="col-md-2"><abbr title="联系电话"><span class="glyphicon glyphicon-earphone"></span></abbr>${bindPro.phone}</div>
									</div>
		    					</p>
							</div>
						</div>
						
					</li>
				</c:forEach>
			</ul>
			
			<div class="btnArea">
    			<input class="btn btn-primary btn-lg active" 	type="button" value="继续绑定" onClick="bind()"  /> 
				<input class="btn btn-default btn-lg active"	type="button" value="取消绑定" onClick="unbind()"  />
            </div>

<!-- 
			<table class="table table-bordered">
				<tr>
					<th>选择</th>
					<th>小区<B>&</B>门牌号</th>
					<th>合同号<B>&</B>角色</th>
					<th>电话</th>
				</tr>
				<c:forEach items="${bindProjects}" var="bindPro">
					<tr>
						<td><input type="checkbox" name="checkbox" value="${bindPro.projectID}-${bindPro.roleID}-${bindPro.userID}"></td>
						<td><B>${bindPro.communityName}</B><BR />${bindPro.communityNum}</td>
						<td><B>${bindPro.contractNum}</B><BR />${bindPro.roleName}</td>
						<td>${bindPro.phone}</td>
					</tr>
				</c:forEach>
				<tr>
					<td colspan="6" style="text-align: center;">
						<input type="button" value="继续绑定" onClick="bind()" class="btn btn-primary btn-lg" /> 
						<input type="button" value="取消绑定" onClick="unbind()" class="btn btn-primary btn-lg" />
					</td>
				</tr>
			</table>
 -->
		</form>
	</div>
</body>
</html>
